package com.hdoit.apollo.web.purchase.modelconfig;

import com.hdoit.apollo.web.shop.providers.SupplierProvider;
import com.tennetcn.core.common.enums.regular.MathRegularExpressions;
import com.tennetcn.web.component.attribute.DisplayNameAttribute;
import com.tennetcn.web.component.attribute.DropDownListAttribute;
import com.tennetcn.web.component.attribute.RegularExpressionAttribute;
import com.tennetcn.web.component.attribute.RequiredAttribute;
import com.tennetcn.web.component.attribute.base.ModelMetadataAttributeConfiguration;

/**
 * @author      humaoshu
 * @email       
 * @createtime  2018年05月23日 09:56:10
 * @comment
 */
public class PurchaseConfig extends ModelMetadataAttributeConfiguration{
    public PurchaseConfig(){
        this.setProperty("supplierId")
            .hasAttribute(new DisplayNameAttribute("供应商"))
             .hasAttribute(new DropDownListAttribute(new SupplierProvider()))
             .hasAttribute(new RequiredAttribute("必填"));

        this.setProperty("purchaseNum")
            .hasAttribute(new DisplayNameAttribute("采购数量"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("purchaseMoney")
            .hasAttribute(new DisplayNameAttribute("采购金额"));

        this.setProperty("otherMoney")
            .hasAttribute(new DisplayNameAttribute("其它金额"));

        this.setProperty("purchaseNo")
            .hasAttribute(new DisplayNameAttribute("采购单号"));

        this.setProperty("purchaseDate")
            .hasAttribute(new DisplayNameAttribute("采购日期"));

        this.setProperty("purchaseName")
            .hasAttribute(new DisplayNameAttribute("采购员"));

        this.setProperty("purchaseState")
            .hasAttribute(new DisplayNameAttribute("采购状态"));

        this.setProperty("purchaseInNum")
            .hasAttribute(new DisplayNameAttribute("入库数量"))
            .hasAttribute(new RegularExpressionAttribute(MathRegularExpressions.naturalNumber));

        this.setProperty("shopId")
            .hasAttribute(new DisplayNameAttribute("门店"));

        this.setProperty("comment")
            .hasAttribute(new DisplayNameAttribute("备注"));

    }
}